package com.gongyibao.gbase.mq.thread;

import javax.jms.Session;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author: 张启峰
 * @Date: 2023/4/17 14:49
 * @Description: gyb-
 */
public class MessagesThroughputRecv {
    public static void main(String[] args) {
        int thrcs = 16; // 线程数
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("开始接收消息" + df.format(new Date()));
        MessagesThroughputRecver mRecver = new MessagesThroughputRecver();
        Session session = mRecver.getSession();
        for (int i = 0; i < thrcs; i++) {
            String queuename = "testmsgTPS" + i;// 队列名称
            MessagesThroughputRecver recvername = new MessagesThroughputRecver(queuename, session);
            recvername.start();
        }
    }
}
